home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
sbin
/
lrm-manager
< prev
next >
Wrap
Text File
|
2008-10-15
|
3KB
|
98 lines
#!/bin/sh
# Note that this script is not only /sbin/lrm-manager, but it also
# ends up being the postinst for nic-restricted-modules. Take care
# when adding features to make sure they'll work in d-i's busybox
# If you wish to disable the link-on-boot feature for certain modules,
# please see /etc/default/linux-restricted-modules-common for details.
set -e
KVER="$(uname -r)"
DEPMOD=yes
while [ $# -gt 0 ]; do
case "$1" in
--kver=*) KVER="${1#--kver=}"; shift ;;
--quick) DEPMOD=no; shift ;;
--list) LIST=yes; shift ;;
--help) echo "Usage: $0 [ --quick ] [ --kver=KERNEL_VERSION ]"; exit 0 ;;
*) shift ;;
esac
done
if [ -f /etc/default/linux-restricted-modules-common ] && [ "$DEPMOD" = "no" ]; then
. /etc/default/linux-restricted-modules-common
fi
# check if we have the kernel objects
if [ ! -d /lib/linux-restricted-modules/"$KVER" ]; then
exit 0
fi
# last-good-boot, do nothing
if grep -q last-good-boot /proc/cmdline; then
exit 0
fi
# if tmpfs is already mounted, skip it.
# NOTE that at this point in time we have no /proc or other fancy things to check
if [ ! -f /lib/modules/"$KVER"/volatile/.mounted ]; then
mkdir -p /lib/modules/"$KVER"/volatile/
mount -t tmpfs -o mode=0755 tmpfs /lib/modules/"$KVER"/volatile/
touch /lib/modules/"$KVER"/volatile/.mounted
fi
cd /lib/linux-restricted-modules/"$KVER"
for module in *; do
CURRENT_MODULE_DISABLED="false"
set -- $DISABLED_MODULES
while [ $# -gt 0 ]; do
case "$1" in
madwifi)
set -- $@ ath_hal ath_pci ath_rate_amrr ath_rate_minstrel \
ath_rate_onoe ath_rate_sample wlan wlan_acl \
wlan_ccmp wlan_scan_ap wlan_scan_sta wlan_tkip \
wlan_wep wlan_xauth
shift
;;
ltm)
set -- $@ ltmodem ltserial
shift
;;
*)
if [ "$1" = "$module" ]; then
CURRENT_MODULE_DISABLED="true"
rm -f /lib/modules/"$KVER"/volatile/$module.ko
if [ "$LIST" = "yes" ]; then
echo "$module"
fi
break
else
shift
fi
;;
esac
done
if [ "$CURRENT_MODULE_DISABLED" = "false" ]; then
if type ld_static >/dev/null 2>&1; then
ld_static -d -r -o /lib/modules/"$KVER"/volatile/$module.ko $module/* || true
fi
fi
done
if [ "$DEPMOD" = "yes" ]; then
if [ -f "/boot/System.map-$KVER" ]; then
depmod -a -q -F /boot/System.map-"$KVER" "$KVER"
elif type udpkg >/dev/null 2>&1; then
# Running in d-i
depmod -a -q
fi
update-initramfs -u -k $KVER
fi
exit 0